Shader "Custom/NewSurfaceShader"
{
        Properties{
            _MainTex("Sprite", 2D) = "white" {}
            _MaskTex("Mask Texture", 2D) = "white" {}
            _MaskStrength("Mask Strength", Range(0, 1)) = 1
        }

            SubShader{
                Tags { "RenderType" = "Opaque" }
                LOD 100

                CGPROGRAM
                #pragma surface surf Lambert

                sampler2D _MainTex;
                sampler2D _MaskTex;
                float _MaskStrength;

                struct Input {
                    float2 uv_MainTex;
                    float2 uv_MaskTex;
                };

                void surf(Input IN, inout SurfaceOutput o) {
                    fixed4 color = tex2D(_MainTex, IN.uv_MainTex);
                    fixed4 mask = tex2D(_MaskTex, IN.uv_MaskTex);
                    fixed4 invertedMask = 1.0 - mask;
                    color.rgb *= invertedMask.rgb * _MaskStrength;
                    o.Albedo = color.rgb;
                    o.Alpha = color.a;
                }
                ENDCG
            }
}
